package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/10/13.
 */

public class CommentList {

    /**
     * id : 1
     * users_id : 2
     * content : qweqweqweqe
     * showphoto_id : 1
     * createtime : 2017-10-18
     * userphoto : http://10.0.2.2/laravel54/public/Uploads/2017-09-01-07-05-26-59a906b68b5b5.jpg
     * username : 戴仁k
     */

    private int id;
    private int users_id;
    private String content;
    private int showphoto_id;
    private String createtime;
    private String userphoto;
    private String username;

    public static CommentList objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), CommentList.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setUsers_id(int users_id) {
        this.users_id = users_id;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setShowphoto_id(int showphoto_id) {
        this.showphoto_id = showphoto_id;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setUserphoto(String userphoto) {
        this.userphoto = userphoto;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getId() {
        return id;
    }

    public int getUsers_id() {
        return users_id;
    }

    public String getContent() {
        return content;
    }

    public int getShowphoto_id() {
        return showphoto_id;
    }

    public String getCreatetime() {
        return createtime;
    }

    public String getUserphoto() {
        return userphoto;
    }

    public String getUsername() {
        return username;
    }
}
